package com.interview.javabase.algorithm;

import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.text.SimpleDateFormat;
import java.time.LocalTime;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @description:
 * @author: zhangshuguang@vichain.com
 * @date: 2019/06/12 15:19
 */
@SpringBootTest
public class Demo9 {

    @Test
    public void solution1() {
        String s0 = " - \n" + "| |\n" + "   \n" + "| |\n" + " - \n";
        String s1 = "   \n" + "|  \n" + "   \n" + "|  \n" + "   \n";
        String s2 = " - \n" + "  |\n" + " - \n" + "|  \n" + " - \n";
        String s3 = " - \n" + "  |\n" + " - \n" + "  |\n" + " - \n";
        String s4 = "   \n" + "| |\n" + " - \n" + "  |\n" + "   \n";
        String s5 = " - \n" + "|  \n" + " - \n" + "  |\n" + " - \n";
        String s6 = " - \n" + "|  \n" + " - \n" + "| |\n" + " - \n";
        String s7 = " - \n" + "  |\n" + "   \n" + "  |\n" + "   \n";
        String s8 = " - \n" + "| |\n" + " - \n" + "| |\n" + " - \n";
        String s9 = " - \n" + "| |\n" + " - \n" + "  |\n" + " - \n";
        String p = "   \n" + " ●\n" + "   \n" + " ●\n" + "   \n";

        String[] arr = {s0, s1, s2, s3, s4, s5, s6, s7, s8, s9};

        int hour = LocalTime.now().getHour();
        int minute = LocalTime.now().getMinute();
        String time = (hour < 10 ? "0" + hour : hour) + ":" + (minute < 10 ? "0" + minute : minute);
        char[] chars = time.toCharArray();
        String[] a1 = arr[Integer.valueOf(String.valueOf(chars[0]))].split("\n");
        String[] a2 = arr[Integer.valueOf(String.valueOf(chars[1]))].split("\n");
        String[] a3 = arr[Integer.valueOf(String.valueOf(chars[3]))].split("\n");
        String[] a4 = arr[Integer.valueOf(String.valueOf(chars[4]))].split("\n");
        String[] pp = p.split("\n");

        for (int i = 0; i < 5; i++) {
            System.out.println(a1[i] + " " + a2[i] + " " + pp[i] + " " + a3[i] + " " + a4[i]);
        }
    }
}
